home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ValueStream.h
-
- Contains: Stream class definition for Textension I/O
-
- Written by: Steve Smith
-
- Copyright: © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
- */
-
-
- #ifndef _VALUESTREAM_
- #define _VALUESTREAM_
-
- #ifndef _Streams_
- #include "Streams.h"
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class ODStorageUnitView;
- class ODStorageUnit;
-
- //========================================================================================
- // CLASS SUValueStream
- //========================================================================================
-
- class SUValueStream : public CStream
- {
- public:
- SUValueStream();
- virtual ~SUValueStream();
-
- void InitValueStream(ODStorageUnitView *view);
- virtual void Free();
-
- virtual OSErr WriteBytes(const void* theBytes, long bytesCount);
- virtual OSErr ReadBytes(void* theBytes, long bytesCount);
-
- virtual long GetPosition() const;
- virtual void SetPosition(long newPosition);
-
- virtual long GetSize() const;
-
- virtual OSErr Append(long count);
- // Appends "count" bytes at the end of the stream, position is not changed
-
- virtual void Empty();
-
- virtual OSErr Load(long size, Ptr* data);
- //fPosition is advanced by "size"
-
- virtual void Unload(Ptr data);
- //should be called even if "Load" returns an error
-
- // ----- New API
- public:
- void Skip(long count);
- // Advance fPosition by "count"
-
- ODStorageUnit *GetStorageUnit();
-
- private:
- Boolean ValidateStorageUnitView() const;
-
- ODStorageUnitView *fView;
- };
-
- #endif
-